package com.googlecode.gwtbb.client.only.remote;

import com.google.gwt.user.client.rpc.AsyncCallback;
import com.googlecode.gwtbb.client.only.GwtUtils;

/**
 * todo used generic AsyncCallback
 * @author Abraham Grief
 * @version $Id$
 * @since Jun 17, 2008
 */
public abstract class NiceCallback<E> implements AsyncCallback<E> {
	public void onFailure(Throwable throwable) {
		GwtUtils.handleFailure(throwable);
	}

	public void onSuccess(E o) {
		handle(o);
	}

	public abstract void handle(E serverResponse);
}
